define(['app'], function(app) {
	'use strict';

	var controller = function controller($scope, Statistics_auction, $stateParams,$ionicSlideBoxDelegate) {

		//接收参数
		$scope.input = new Object();
		$scope.input.id = $stateParams.id;
		$scope.auction_nums = new Object();
		
		//滑动切换
		$scope.selectTab = 0;
		$scope.activeSlide = function(index) {
			$scope.selectTab = index;
			$ionicSlideBoxDelegate.$getByHandle('tab-handle').slide(index);
		};
	    //滑动切换
		$scope.slideChanged = function(index) {
			$scope.selectTab = index;
		};

		//加载数据
		$scope.init_data = function() {
			//取得热销的商品列表
			Statistics_auction.getinfo($scope.input.id, function(data) {
				$scope.datas = data;
				
				
			});
		}
		$scope.init_data(); //必须在定义之后

		
		
	}

	controller.$inject = ['$scope', 'Statistics_auction','$stateParams', '$ionicSlideBoxDelegate'];
	
	return app.registerController("statistics_auctionctrl",controller);
});


